#!/bin/bash

# This script for release [MAC OS] release application.

OUTPUT_DIR=$1
if [ "$OUTPUT_DIR" = "" ]; then
	OUTPUT_DIR=`pwd`/_OUTPUT_
fi

# find app file
APP=$OUTPUT_DIR/`ls -1 $OUTPUT_DIR|grep app`

which macdeployqt

if [ "$?" = "0" ]; then
    macdeployqt $APP -dmg
    echo ""
    echo "Make app dmg done!"
    echo ""
    echo "File in: $OUTPUT_DIR/"
    echo ""
    ls -l $OUTPUT_DIR
    echo ""
    exit
fi

echo "can't find [macdeployqt] tool, you need set qt dir path into shell environment!"
